package tw.edu.tku.im.maze;

import org.json.JSONException;
import org.json.JSONObject;

public class UpdateRoomReq extends ReqPacket {

   int roomID;
   
   //-------------------------------------------------------
   public UpdateRoomReq(int roomID) {
      this.roomID = roomID;
   }
   
   //-------------------------------------------------------
   public int getRoomID() {
      return this.roomID;
   }
   public void setRoomID(int roomID) {
      this.roomID = roomID;
   }
   
   //-------------------------------------------------------
   public String toJSONString() throws JSONException {
      JSONObject parameter = new JSONObject();
      parameter.put("roomID", this.roomID);
      JSONObject jsonObj = new JSONObject();
      jsonObj.put("parameter", parameter);
      jsonObj.put("action", "updateRoom");
      return jsonObj.toString();
   }

   @Override
   public String getPacketName() {
      return "updateRoom";
   }

}
